#include<stdio.h>
int main()
{
    float t;
    scanf("%f",&t);
    char a;
    scanf("%c",&a);
    if(a=='c'||a=='C')
    {
        float F = 32+(9*t/5);
        printf("%.2fF",F);
    }
    else if(a=='f'||a=='F')
    {

        float C = 5*(t-32)/9;
        printf("%.2fC",C);
    }
    else
    {
        printf("Error");
    }
        return 0;






    
}
